﻿using RXY_Mall.Domain;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;


namespace RXY_Mall.Application.Return.Dto
{
    public class ReturnDto
    {

        #region 退换货
        /// <summary>
        /// 退换货列表输出信息
        /// </summary>
        public class GetOrderReturnsOutput
        {
            /// <summary>
            /// 退换货ID
            /// </summary>
            public int return_id { get; set; }
            /// <summary>
            /// 退换货号
            /// </summary>
            public string return_no { get; set; }
            /// <summary>
            /// 联系人
            /// </summary>
            public string contact_name { get; set; }
            /// <summary>
            /// 联系电话
            /// </summary>
            public string contact_mobile { get; set; }
            /// <summary>
            /// 店铺
            /// </summary>
            public string shop_name { get; set; }
            /// <summary>
            /// 订单金额
            /// </summary>
            public decimal order_amount { get; set; }
            /// <summary>
            /// 退款金额
            /// </summary>
            public Nullable<decimal> refund_amount { get; set; }
            /// <summary>
            /// 退换货类型
            /// </summary>
            public int _return_type { get; set; }
            /// <summary>
            /// 退换货类型
            /// </summary>
            public string return_type { get; set; }
            /// <summary>
            /// 退换货原因
            /// </summary>
            public int _return_reason { get; set; }
            /// <summary>
            /// 退换货原因
            /// </summary>
            public string return_reason { get; set; }
            /// <summary>
            /// 退换货状态
            /// </summary>
            public int _return_status { get; set; }
            /// <summary>
            /// 退换货状态
            /// </summary>
            public string return_status { get; set; }
            /// <summary>
            /// 申请时间
            /// </summary>
            public System.DateTime add_time { get; set; }
            /// <summary>
            /// 过期时间
            /// </summary>
            public System.DateTime expire_time { get; set; }
            /// <summary>
            /// 审核通过时间
            /// </summary>
            public Nullable<System.DateTime> audit_pass_time { get; set; }
            /// <summary>
            /// 审核未通过时间
            /// </summary>
            public Nullable<System.DateTime> audit_fail_time { get; set; }
            /// <summary>
            /// 买家发货时间
            /// </summary>
            public Nullable<System.DateTime> user_shipment_time { get; set; }
            /// <summary>
            /// 卖家收货时间
            /// </summary>
            public Nullable<System.DateTime> shop_receive_time { get; set; }
            /// <summary>
            /// 商家退款时间
            /// </summary>
            public Nullable<System.DateTime> shop_refund_time { get; set; }
            /// <summary>
            /// 商家发货时间
            /// </summary>
            public Nullable<System.DateTime> shop_shipment_time { get; set; }
            /// <summary>
            /// 卖家收货时间
            /// </summary>
            public Nullable<System.DateTime> user_receive_time { get; set; }
            /// <summary>
            /// 完成时间
            /// </summary>
            public Nullable<System.DateTime> complete_time { get; set; }
            /// <summary>
            /// 取消时间
            /// </summary>
            public Nullable<System.DateTime> cancel_time { get; set; }
            public int shop_id { get; internal set; }
        }

        /// <summary>
        /// 退换货详情输出信息
        /// </summary>
        public class GetReturnOutput : GetOrderReturnsOutput
        {
            internal gw_return_audit gw_return_audit;

            /// <summary>
            /// 订单号
            /// </summary>
            public string order_no { get; set; }
            /// <summary>
            /// 订单ID
            /// </summary>
            public int order_id { get; set; }

            /// <summary>
            /// 店铺信息
            /// </summary>
            public ShopOutput shop { get; internal set; }
            /// <summary>
            /// 订单商品
            /// </summary>
            public OrderGoods goods { get; set; }
            /// <summary>
            /// 买家运单信息
            /// </summary>
            public Waybill buyer_waybill { get; set; }
            /// <summary>
            /// 商家运单信息
            /// </summary>
            public Waybill merchant_waybill { get; set; }
            /// <summary>
            /// 申请信息
            /// </summary>
            public ReturnRequest request { get; internal set; }
            /// <summary>
            /// 审核信息
            /// </summary>
            public ReturnAudit audit { get; set; }
            /// <summary>
            /// 进度
            /// </summary>
            public List<ProcessItem> process { get; set; }
        }


        public class ReturnOrder
        {
            /// <summary>
            /// 退单号
            /// </summary>
            public string return_no { get; set; }
            /// <summary>
            /// 是否可申请售后
            /// </summary>
            public bool is_return_request { get; set; }
        }

        /// <summary>
        /// 运单信息
        /// </summary>
        public class Waybill
        {
            /// <summary>
            /// 运单号
            /// </summary>
            public string waybill_no { get; set; }
            /// <summary>
            /// 物流公司
            /// </summary>
            public string company_name { get; set; }
            /// <summary>
            /// 联系电话
            /// </summary>
            public string telphone { get; set; }
            /// <summary>
            /// 添加时间
            /// </summary>
            public DateTime add_time { get; set; }
        }

        /// <summary>
        /// 订单商品
        /// </summary>
        public class OrderGoods
        {
            public string json_specs { get; set; }
            /// <summary>
            /// 商品类别ID
            /// </summary>
            public int category_id { get; set; }
            /// <summary>
            /// 商品ID
            /// </summary>
            public int goods_id { get; set; }
            /// <summary>
            /// 商品类型
            /// </summary>
            public GoodsType goods_type { get; set; }
            /// <summary>
            /// 商品名
            /// </summary>
            public string goods_name { get; set; }
            /// <summary>
            /// 购买类型
            /// </summary>
            public BuyType buy_type { get; set; }
            /// <summary>
            /// 商品规格
            /// </summary>
            public List<SpecOutput> specs { get; set; }
            /// <summary>
            /// 商品价格
            /// </summary>
            public string goods_price { get; set; }
            /// <summary>
            /// 商品数量
            /// </summary>
            public int goods_quantity { get; set; }
            /// <summary>
            /// 商品图片
            /// </summary>
            public string picture_url { get; set; }
        }

        /// <summary>
        /// 订单地址
        /// </summary>
        public class OrderAddress
        {
            /// <summary>
            /// 收货人
            /// </summary>
            public string accepter_name { get; set; }
            /// <summary>
            /// 电话号码
            /// </summary>
            public string mobile { get; set; }
            /// <summary>
            /// 省市区逗号分隔
            /// </summary>
            public string area { get; set; }
            /// <summary>
            /// 详细地址
            /// </summary>
            public string address { get; set; }
        }

        /// <summary>
        /// 商品规格输出类
        /// </summary>
        public class SpecOutput
        {
            /// <summary>
            /// 规格键
            /// </summary>
            public string spec_key { get; set; }
            /// <summary>
            /// 规格值
            /// </summary>
            public string spec_value { get; set; }
        }

        /// <summary>
        /// 店铺输出类
        /// </summary>
        public class ShopOutput
        {
            /// <summary>
            /// 店铺ID
            /// </summary>
            public int shop_id { get; set; }
            /// <summary>
            /// 店铺名称
            /// </summary>
            public string shop_name { get; set; }
            /// <summary>
            /// 店铺logo
            /// </summary>
            public string shop_logo { get; set; }
            /// <summary>
            /// 商品数量
            /// </summary>
            public int goods_count { get; set; }
            /// <summary>
            /// 订单数量
            /// </summary>
            public int order_count { get; set; }
            /// <summary>
            /// 固定电话
            /// </summary>
            public string telephone { get; set; }
            /// <summary>
            /// 手机号
            /// </summary>
            public string mobile { get; set; }
            /// <summary>
            /// 微信
            /// </summary>
            public string wechat { get; set; }
            /// <summary>
            /// QQ
            /// </summary>
            public string qq { get; set; }
        }

        /// <summary>
        /// 进度项
        /// </summary>
        public class ProcessItem
        {
            /// <summary>
            /// 标题
            /// </summary>
            public string title { get; set; }
            /// <summary>
            /// 内容
            /// </summary>
            public string content { get; set; }
            /// <summary>
            /// 时间
            /// </summary>
            public DateTime date { get; set; }
        }

        /// <summary>
        /// 申请信息
        /// </summary>
        public class ReturnRequest
        {
            /// <summary>
            /// 退换货类型
            /// </summary>
            public ReturnType return_type { get; set; }
            /// <summary>
            /// 退换货原因
            /// </summary>
            public ReturnReason return_reason { get; set; }
            /// <summary>
            /// 说明
            /// </summary>
            public string remark { get; set; }
            /// <summary>
            /// 联系人
            /// </summary>
            public string contact_name { get; set; }
            /// <summary>
            /// 手机号
            /// </summary>
            public string contact_mobile { get; set; }
            /// <summary>
            /// 凭证图片
            /// </summary>
            public List<string> pictures { get; set; }
            /// <summary>
            /// 添加时间
            /// </summary>
            public long add_time { get; set; }
        }

        /// <summary>
        /// 商家审核
        /// </summary>
        public class ReturnAudit
        {
            /// <summary>
            /// 是否通过
            /// </summary>
            public string is_pass { get; set; }
            /// <summary>
            /// 审核说明
            /// </summary>
            public string audit_note { get; set; }
            /// <summary>
            /// 备注
            /// </summary>
            public string remark { get; set; }
            /// <summary>
            /// 审核时间
            /// </summary>
            public DateTime add_time { get; set; }
        }

        /// <summary>
        /// 修改审核
        /// </summary>
        public class UpdateReturnAuditInput : BaseInput
        {
            /// <summary>
            /// 服务号ID
            /// </summary>
            public int return_id { get; set; }
            /// <summary>
            /// 是否通过
            /// </summary>
            public int is_pass { get; set; }
            /// <summary>
            /// 审核说明
            /// </summary>
            public string audit_note { get; set; }
            /// <summary>
            /// 收货地址
            /// </summary>
            public string audit_remark { get; set; }
        }

        /// <summary>
        /// 修改退款
        /// </summary>
        public class UpdateReturnRefundInput : BaseInput
        {
            /// <summary>
            /// 服务号ID
            /// </summary>
            public int return_id { get; set; }
        }

        /// <summary>
        /// 修改发货
        /// </summary>
        public class UpdateReturnShipmentInput : BaseInput
        {
            [Required(ErrorMessage = "服务号不能为空")]
            public int return_id { get; set; }
            [Required(ErrorMessage = "快递公司不能为空")]
            public string logistics_name { get; set; }
            [Required(ErrorMessage = "运单号不能为空")]
            public string waybill_no { get; set; }
        }

        #endregion

    }
}
